package Arrays;

import java.util.Arrays;

/**
 * 作者:hfj
 * 功能:1.合并两个有序数组
 * 日期: 2024/6/13 20:47
 */
public class TwoNumberMerge {

    public static void main(String[] args) {
        int[] nums = {3,5,6,2,9};
        int target =11;
        System.out.println(Arrays.toString(twoSum(nums,target)));
    }

    public static int[] twoSum(int[] nums,int target){
        for (int i = 0; i < nums.length; i++) {
            for (int j = i+1; j < nums.length; j++) {
                if (nums[i] + nums[j] == target){
                    return new int[]{i,j};
                }
            }
        }
        return null;
    }
}
